package day_2022_4_to_7.day48;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author haomin
 * @date 2022/04/18 10:01
 **/
public class Day1_1_TotalMaxlevelValue {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n*3];
        for(int i = 0;i < n*3 ;i++){
            arr[i] = in.nextInt();
        }

        Arrays.sort(arr);
        int sum = 0;
        int lenth = arr.length;
        for(int i = 0;i < n;i++){
            lenth = lenth - 2;
            sum += arr[lenth];
        }
        System.out.println(sum);
    }
}